/*
** declares and defines P
*/

#ifndef POINT_HPP
#define POINT_HPP

class P {
    public:
        int x;
        int y;
        P(int nx, int ny) { x = nx; y = ny; };
        P(const P& np) { x = np.x; y = np.y; };
        P() { x = y = 0; }

        P operator = (const P& rhs) { x = rhs.x; y = rhs.y; return *this; };
        P operator + (const P& rhs) { return P(x + rhs.x, y + rhs.y); };
        P operator - (const P& rhs) { return P(x - rhs.x, y - rhs.y); };
        P operator += (const P& rhs) { x += rhs.x; y += rhs.y; return *this; };
        P operator -= (const P& rhs) { x -= rhs.x; y -= rhs.y; return *this; };
        P operator * (int rhs) { return P(x*rhs, y*rhs); };
        P operator *= (int rhs) { x *= rhs; y *= rhs; return *this; };
        P operator / (int rhs) { return P(x/rhs, y/rhs); };
        P operator /= (int rhs) { x /= rhs; y /= rhs; return *this; };
};

#endif
